package com.quanyan.place.service;


import com.quanyan.api.APIResponse;
import com.quanyan.common.Plugin.PageObj;
import com.quanyan.place.entity.TbBizPlaceBuyContract;
import com.quanyan.place.entity.TbBizPlaceBuyContractDetail;
import com.quanyan.place.entity.apireq.ReqContractPay;
import com.quanyan.place.entity.apireq.ReqPlaceContractInfoVo;
import com.quanyan.place.entity.apiresp.RespPlaceContractInfoVo;

import java.util.List;


/**
 * 合同管理Service
 * Created by liuyaoxin on 2016/8/19.
 */
public interface ContractService {


    List<TbBizPlaceBuyContractDetail> getContractDetailByContractId(Integer contractId);

    PageObj<List<RespPlaceContractInfoVo>> getContractList(ReqPlaceContractInfoVo reqVo);

    List<RespPlaceContractInfoVo> getContractListByPlaceId(ReqPlaceContractInfoVo reqVo);

    TbBizPlaceBuyContract getContractInfoById(Integer contractId);

    TbBizPlaceBuyContract getContractInfoByContractNo(String contractNo);

    APIResponse updatePlaceContratctInfo(ReqPlaceContractInfoVo reqVo);

    APIResponse updatePlaceContratctDetailInfo(ReqPlaceContractInfoVo reqVo);

    APIResponse deletePlaceContratctInfo(ReqPlaceContractInfoVo reqVo);

    APIResponse deletePlaceContratctDetailInfo(ReqPlaceContractInfoVo reqVo);

    APIResponse setVerifyFlag(Integer contractId, Integer newStatus);

    APIResponse CheckContractForVerify(Integer contractId);

    APIResponse verifyContratctInfo(ReqPlaceContractInfoVo reqVo);

    APIResponse stopPlaceContratct(ReqPlaceContractInfoVo reqVo);

    APIResponse stopPlaceContratctDetail(ReqPlaceContractInfoVo reqVo);

    List<RespPlaceContractInfoVo> expotrContractList(ReqPlaceContractInfoVo reqVo);

    List<TbBizPlaceBuyContractDetail> getPlaceIdAndUnitIdByContractId(Integer contractId);

    void updateContractStatus();

    // 用来处理合同备份（合同历史）
    APIResponse BackupContractHistory(Integer contractId, Integer version);

    // 修改历史合同的执行时间
    APIResponse UpdateContractExecuteTime(Integer contractId, Integer version);

    // 清除合同的所有历史版本
    APIResponse ClearContractHistory(Integer contractId);

    // 获取合同支付列表
    APIResponse<?> getContractPayList(Integer contractId);

    // 插入或更新合同支付
    APIResponse<?> updateContractPay(ReqContractPay reqVo);

    // 删除合同支付
    APIResponse<?> deleteContractPay(ReqContractPay reqVo);

    //当合同中止或废弃或到期结束时，更新场馆状态，场地状态及solr
    void updatePlaceStatusWhenContractStopOrDelete(Integer placeId,Integer contractId);

    boolean updateSolrIndex(Integer placeId);
}
